<?
require 'global.php';

$page=1; if(isset($_GET['page']))$page=$_GET['page'];
$pid=0; if(isset($_GET['pid'])) $pid=$_GET['pid'];

$product_review->rows=10;
//get approved reviews related to this product 获取通过审核的产品的评论
$where=array(array("name"=>"product_id","val"=>$pid),array("name"=>"review_status","val"=>2));
$pages=$product_review->count_pages($where);
$product_review_array=$product_review->get_page($page,$where);

$str='';
$k=0;
foreach($product_review_array as $val)
{
	$str.='<div class="faq">
		<div class="faqq"><table><tr><td class="faqr" width="132">
			<div class="rating star'.$val['rating'].'"></div><div class="gray">by '.$val['customer_name'].'<br />'.$val['created_time'].'</div>
		</td><td>'.d($val['content']).'</td></tr></table></div>
	</div>';
	$k++;
}
$str.=echo_page_ajax($page, $pages, 'goToPage',$lang_id);
$str.='';

echo $str;
